package hai.nguyenvan.service;

import java.sql.Connection;
import java.sql.DriverManager;

public class DatabaseConnection {
	Connection conn;

	public Connection getConn() {
		return conn;
	}

	public void setConn(Connection conn) {
		this.conn = conn;
	}

	public String connectDatabase(String user, String password) {
		try {
			conn = null;
			Class.forName("oracle.jdbc.driver.OracleDriver");
			conn = DriverManager.getConnection("jdbc:oracle:thin:@localhost:1521:orcl", user, password);
			return "Connected Successfull";
		} catch (Exception e) {
			// TODO Auto-generated catch block
			return "Error " + e.toString();
		}

	}
}
